//
//  CityHunterTableViewCell.m
//  Travelmemory
//
//  Created by lanou3g on 16/4/2.
//  Copyright © 2016年 ABCD. All rights reserved.
//

#import "CityHunterTableViewCell.h"

//  宽
#define mywidth self.contentView.frame.size.width

// 高
#define myheight self.contentView.frame.size.height

@implementation CityHunterTableViewCell

-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{

    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        
        [self initLayout];
    }


    return self;
}






-(void)initLayout{

//    主图片

    self.MainImage = [[UIImageView alloc] init];
    self.MainImage.backgroundColor = [UIColor grayColor];
    self.MainImage.frame = CGRectMake(50, 10, mywidth - 10, 200);
    [self.contentView addSubview:self.MainImage];
    
    self.UserImage1 = [[UIImageView alloc]initWithFrame:CGRectMake(mywidth - 42.5, 185, 65, 65)];
    self.UserImage1.backgroundColor = [UIColor whiteColor];
    self.UserImage1.layer.masksToBounds = YES;
    self.UserImage1.layer.cornerRadius = 30;
    [self.contentView addSubview:self.UserImage1];
    
    //    用户头像
    self.UserImage = [[UIImageView alloc]initWithFrame:CGRectMake(mywidth - 40, 187.5, 60, 60)];
    self.UserImage.backgroundColor = [UIColor whiteColor];
    self.UserImage.layer.masksToBounds = YES;
    self.UserImage.layer.cornerRadius = 30;
    [self.contentView addSubview:self.UserImage];
    
    
//     标题
    self.TitleLabel = [[UILabel alloc]initWithFrame:CGRectMake(50, CGRectGetMaxY(self.MainImage.frame) + 5, mywidth - 100 , 50)];
    self.TitleLabel.numberOfLines = 0;
    self.TitleLabel.font = [UIFont fontWithName:@"Helvetica-Bold" size:17];
    [self.contentView addSubview:self.TitleLabel];
//     时间地址
    self.TimeAddress = [[UILabel alloc]initWithFrame:CGRectMake(50, CGRectGetMaxY(self.TitleLabel.frame) + 5, mywidth - 20, 20)];
    self.TimeAddress.font = [UIFont systemFontOfSize:14];
    self.TimeAddress.textColor = [UIColor grayColor];
    [self.contentView addSubview:self.TimeAddress];
//     用于布局标签
    self.Myview = [[UIView alloc]initWithFrame:CGRectMake(50, CGRectGetMaxY(self.TimeAddress.frame) + 5, mywidth - 110, 50)];
    [self.contentView addSubview:_Myview];
//      人民币符号
    self.MoneyLabel = [[UILabel alloc]initWithFrame:CGRectMake(CGRectGetMaxX(self.Myview.frame)+ 5, CGRectGetMinY(self.Myview.frame) , 20, 28)];
    self.MoneyLabel.text = @"￥";
    self.MoneyLabel.font = [UIFont systemFontOfSize:20];
    self.MoneyLabel.textColor = [UIColor redColor];
    [self.contentView addSubview:_MoneyLabel];
//      价格
    self.PriceLabel = [[UILabel alloc]initWithFrame:CGRectMake(CGRectGetMaxX(self.MoneyLabel.frame), CGRectGetMinY(self.MoneyLabel.frame) + 5, 65, 35)];
    self.PriceLabel.text = @"248";
    self.PriceLabel.font = [UIFont systemFontOfSize:20];
    self.PriceLabel.textColor = [UIColor redColor];
    [self.contentView addSubview:_PriceLabel];
}

- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
